<?php
/**
 *
 * 版权所有：恰维网络<qwadmin.qiawei.com>
 * 作    者：寒川<hanchuan@qiawei.com>
 * 日    期：2016-01-20
 * 版    本：1.0.0
 * 功能说明：网站设置控制器。
 *
 **/

namespace Qwadmin\Controller;

class StaffController extends ComController
{
    public function index()
    {
            $list = M('feed')->where(['uid'=>$_SESSION['uid']])->order('id desc')->select();
            // P($list);
            $this->assign('list',$list);

            $this->display();
      
    }


    //添加绩效反馈
    public function add()
    {
        if (IS_POST) {
            // dump(I());
            $list = $_POST;
            $list['time'] = date('Y-m-d H:s');
            $list['yue'] = date('m');
            if (M('feed')->add($list) > 0) {
                    $this->success('提交成功','index');
            }else{
                    $this->error('提交失败,请重新填写.');
            }
        }else{
            $ulist = M('member')->where(['uid'=>$_SESSION['uid']])->select();
            $time =$time = date('Y-m-d H:s');
            $this->assign('ulist',$ulist);
            $this->assign('time',$time);
            $this->display();
        }



    }









    public function xiang()
    {
        // dump(I());
        // exit;
        
                $list = M('feed')->where(['id'=>$_GET['id']])->select();
                // $guo = $list[0]['result'];
                $this->assign('list',$list);
                // $this->assign('guo',$guo);
                $this->display();
           
    }




    public function clist()
    {
            if ($_GET['type'] == '1') {
                $list = M('feed')->where(['id'=>$_GET['id']])->select();
                // dump($list);
                // exit;
                $this->assign('list',$list);
                $this->display('chu');
            }else{
                   if ($_GET['type'] == '2') {
                            $list = M('feed')->where(['id'=>$_GET['id']])->select();
                            $empty = '1';
                            $this->assign('list',$list);
                            $this->assign('empty',$empty);
                            $this->display('chu');
                   }else{
                        $list = M('feed')->order('id desc')->select();
                        $this->assign('list',$list);
                        $this->display();
                   }
            }

        
    }



    public function chu()
    {
       // dump(I());
       // exit;
       $result['chu'] = $_POST['chu'];
       $result['type'] ='2';
       if (M('feed')->where(['id'=>$_POST['id']])->save($result) > 0) {
            $this->success('处理成功','clist');
       }else{
            $this->error('处理失败，请重新填写。');
       }

    
        
    }




}